package com.apes.scm.stock.safetyStock.service;

import com.apes.framework.plugin.esb.api.SimpleRequest;
import com.apes.framework.util.DateUtil;
import com.apes.scm.stock.safetyStock.model.StockGapDistributionInfo;
import com.apes.scm.stock.safetyStock.repository.StockGapDistributionInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service("stockGapDistributionInfoService")
public class StockGapDistributionInfoService {
    @Autowired
    private StockGapDistributionInfoRepository stockGapDistributionInfoRepository;

    public void create(SimpleRequest request) {
        StockGapDistributionInfo stockGapDistributionInfo = request.getO(StockGapDistributionInfo.class);
        stockGapDistributionInfo.setExecuteData(DateUtil.getDate(DateUtil.SHOW_DATE_FORMAT));
        stockGapDistributionInfoRepository.save(stockGapDistributionInfo);
    }
}
